import Vue from 'vue';
import Router from 'vue-router';
import Home from 'pages/home/Home';
import Regist from 'pages/regist/Regist'; 
import Login from 'pages/login/Login';
import Stick from 'pages/stick/Stick';
import ErrorPage from 'pages/error/ErrorPage';
import Detail from 'pages/detail/Detail';
import Create from 'pages/create/Create';

Vue.use(Router);

export default new Router({
  routes: [{
      path: '/',
      name: 'Stick',
      component: Stick,
      meta: {
        title: '本站新帖 - 核客论坛 - Powered by phpwind',
      }
    },{
      path: '/home',
      name: 'Home',
      component: Home,
      meta: {
        title: '核客论坛 - Powered by phpwind'
      }
    },
    {
      path: '/regist',
      name: 'Regist',
      component: Regist,
      meta: {
        title: '注册 - 核客论坛 - Powered by phpwind'
      }
    },
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta: {
        title: '登录 - 核客论坛 - Powered by phpwind'
      }
    },{
      path: '/detail/:route/:data',
      name: 'Detail',
      component: Detail,
      meta: {
        title: ''
      }
    },{
      path: '/create',
      name: 'Create',
      component: Create,
      meta: {
        title: '发表帖子 - 核客论坛 - Powered by phpwind'
      }
    },{
      path: '/error',
      name: 'ErrorPage',
      component: ErrorPage,
      meta: {
        title: '错误 - 核客论坛 - Powered by phpwind'
      }
    }
  ],
    scrollBehavior (to, from, savedPosition) {
      return { x: 0, y: 0 }
    }
});
